﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Jwell.Template.App.Utl
{
    public static class CollectionExtension
    {
        public static IList<T> Remove<T>(this IList<T> sources, Func<T, bool> condition)
        {
            if (condition == null)
                return sources;
            IList<T> result=new List<T>();
            foreach (var item in sources)
            {
                if (!condition.Invoke(item))
                    result.Add(item);
            }

            return result;
        }
    }
}
